package com.jeesite.modules.purchaseoutbound.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 采购退库单Entity
 * @author 码脑洞
 * @version 2025-04-13
 */
@Table(name="t_purchase_outbound_lines", alias="a", label="采购退库单信息", columns={
		@Column(name="auto_id", attrName="autoId", label="主键", isPK=true),
		@Column(name="header_id", attrName="headerId.autoId", label="头表ID"),
		@Column(name="source_bill_type", attrName="sourceBillType", label="来源类型"),
		@Column(name="source_bill_id", attrName="sourceBillId", label="来源单据ID"),
		@Column(name="source_bill_no", attrName="sourceBillNo", label="来源单号"),
		@Column(name="source_bill_line_id", attrName="sourceBillLineId", label="来源单据DID"),
		@Column(name="source_bill_row_no", attrName="sourceBillRowNo", label="行号", isUpdateForce=true),
		@Column(name="inv_id", attrName="invId", label="存货ID", isUpdateForce=true),
		@Column(name="warehouse_id", attrName="warehouseId", label="仓库ID", isUpdateForce=true),
		@Column(name="area_id", attrName="areaId", label="仓区ID", isUpdateForce=true),
		@Column(name="shelves_id", attrName="shelvesId", label="货架ID", isUpdateForce=true),
		@Column(name="position_id", attrName="positionId", label="库位ID", isUpdateForce=true),
		@Column(name="qty", attrName="qty", label="数量", isUpdateForce=true),
		@Column(name="outbound_qty", attrName="outboundQty", label="退库数量", isUpdateForce=true),
		@Column(name="status", attrName="status", label="状态", comment="状态（0正常 1删除 2停用 3冻结 4审核 5驳回 9草稿）;状态（0正常 1删除 2停用 3冻结 4审核 5驳回 9草稿）", isUpdate=false),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
	}, orderBy="a.auto_id ASC"
)
public class PurchaseOutboundLines extends DataEntity<PurchaseOutboundLines> {
	
	private static final long serialVersionUID = 1L;
	private Long autoId;		// 主键
	private PurchaseOutboundHeader headerId;		// 头表ID 父类
	private String sourceBillType;		// 来源类型
	private String sourceBillId;		// 来源单据ID
	private String sourceBillNo;		// 来源单号
	private String sourceBillLineId;		// 来源单据DID
	private Integer sourceBillRowNo;		// 行号
	private Long invId;		// 存货ID
	private Long warehouseId;		// 仓库ID
	private Long areaId;		// 仓区ID
	private Long shelvesId;		// 货架ID
	private Long positionId;		// 库位ID
	private BigDecimal qty;		// 数量
	private BigDecimal outboundQty;		// 退库数量

	public PurchaseOutboundLines() {
		this(null);
	}

	public PurchaseOutboundLines(PurchaseOutboundHeader headerId){
		this.headerId = headerId;
	}
	
	@JsonSerialize(using = ToStringSerializer.class)
	public Long getAutoId() {
		return autoId;
	}

	public void setAutoId(Long autoId) {
		this.autoId = autoId;
	}
	
	public PurchaseOutboundHeader getHeaderId() {
		return headerId;
	}

	public void setHeaderId(PurchaseOutboundHeader headerId) {
		this.headerId = headerId;
	}
	
	@Size(min=0, max=1, message="来源类型长度不能超过 1 个字符")
	public String getSourceBillType() {
		return sourceBillType;
	}

	public void setSourceBillType(String sourceBillType) {
		this.sourceBillType = sourceBillType;
	}
	
	@Size(min=0, max=64, message="来源单据ID长度不能超过 64 个字符")
	public String getSourceBillId() {
		return sourceBillId;
	}

	public void setSourceBillId(String sourceBillId) {
		this.sourceBillId = sourceBillId;
	}
	
	@Size(min=0, max=64, message="来源单号长度不能超过 64 个字符")
	public String getSourceBillNo() {
		return sourceBillNo;
	}

	public void setSourceBillNo(String sourceBillNo) {
		this.sourceBillNo = sourceBillNo;
	}
	
	@Size(min=0, max=64, message="来源单据DID长度不能超过 64 个字符")
	public String getSourceBillLineId() {
		return sourceBillLineId;
	}

	public void setSourceBillLineId(String sourceBillLineId) {
		this.sourceBillLineId = sourceBillLineId;
	}
	
	public Integer getSourceBillRowNo() {
		return sourceBillRowNo;
	}

	public void setSourceBillRowNo(Integer sourceBillRowNo) {
		this.sourceBillRowNo = sourceBillRowNo;
	}
	
	public Long getInvId() {
		return invId;
	}

	public void setInvId(Long invId) {
		this.invId = invId;
	}
	
	public Long getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
	}
	
	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}
	
	public Long getShelvesId() {
		return shelvesId;
	}

	public void setShelvesId(Long shelvesId) {
		this.shelvesId = shelvesId;
	}
	
	public Long getPositionId() {
		return positionId;
	}

	public void setPositionId(Long positionId) {
		this.positionId = positionId;
	}
	
	public BigDecimal getQty() {
		return qty;
	}

	public void setQty(BigDecimal qty) {
		this.qty = qty;
	}
	
	public BigDecimal getOutboundQty() {
		return outboundQty;
	}

	public void setOutboundQty(BigDecimal outboundQty) {
		this.outboundQty = outboundQty;
	}
	
}